import request from "../utils/request";

export function getDeviceList(device) {
    return request({
        url: '/device/list',
        method: 'get',
        params: device // 使用 params 传递查询参数
    });
}

export function getDeviceInfo(deviceId) {
    return request({
        url: `/device/${deviceId}`,
        method: 'get'
    });
}


export function addDevice(device) {
    return request({
        url: '/device/add',
        method: 'post',
        data: device // 使用 data 传递请求体
    });
}

export function editDevice(device) {
    return request({
        url: '/device/edit',
        method: 'post',
        data: device // 使用 data 传递请求体
    });
}

export function deleteDevice(deviceId) {
    return request({
        url: `/device/${deviceId}`,
        method: 'delete'
    });
}